/**
 * Copyright ©
 * 
 * @author: zw
 * @date: 2022-11-25 
 */


import React, { Component, Reducer } from 'react';
import { useDispatch, useSelector } from "react-redux";
import { Button } from "antd";

// import './style.less';
const view = () => {
  const { num } = useSelector((state: RootState) => ({ num: state.num }));

  const dispatch = useDispatch();

  const changeNum = () => {
    dispatch({ type: "add", val: 10 });
  }
  return (
    <div className="home">
      <p>{num}</p>
      <Button type='primary' onClick={changeNum}>button</Button>
    </div>
  )
}

export default view